package middle;

import java.util.Arrays;

public class Solution_907 {

    public static void main(String[] args) {
        System.out.println(Math.sqrt(4.5));
    }

    public int sumSubarrayMins(int[] arr) {
        long sum = 0;
        Arrays.sort(arr);
        for (int i = 0; i < arr.length; i++) {
            sum = sum + (long) arr[i] * (arr.length - i);
            sum = sum % 10000000007L;
        }
        return (int)(sum % 10000000007L);
    }
}
